package com.dkh.recommend.controller;


import com.dkh.recommend.dto.Result;
import com.dkh.recommend.entity.TbLabel;
import org.springframework.stereotype.Controller;
import com.dkh.recommend.service.ITbLabelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author dkh
 * @since 2022-12-14
 */
@Slf4j
@RestController
@Api(value = "", tags = "", description="")
@RequestMapping("/label")
public class TbLabelController {

    @Autowired
    private ITbLabelService tbLabelService;

    @GetMapping("/getall")
    public Result getAllLabel(){
        List<TbLabel> labelList = tbLabelService.list();
        return Result.ok(labelList);
    }

    @GetMapping("/getlabelbymusicid/{musicId}")
    public Result getLabelByMusicId(@PathVariable String musicId){

    return   tbLabelService.getLabelByMusicId(musicId);

    }


    //    喜好分析
    @GetMapping("/like/analysis")
    public Result LikeAnalysis(){
        return  tbLabelService.LikeAnalysis();
    }

}
